package com.building_msmart.ulti;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;

public class Alertdialog_ {

	@SuppressWarnings("deprecation")
	public void alert(int reslId,String title, String mess, Activity ac){
		 AlertDialog alertDialog = new AlertDialog.Builder(ac).create();

			// Setting Dialog Title
			alertDialog.setTitle(title);

			// Setting Dialog Message
			alertDialog.setMessage(mess);

			// Setting Icon to Dialog
			alertDialog.setIcon(reslId);

			// Setting OK Button
			alertDialog.setButton("OK",
					new DialogInterface.OnClickListener() {

						public void onClick(DialogInterface dialog,
								int which) {
							// Write your code here to execute after dialog
							// closed
							//Toast.makeText(getApplicationContext(),"You clicked on OK", Toast.LENGTH_SHORT).show();
						}
					});

			// Showing Alert Message
			alertDialog.show();
	}
}
